#pragma once

#include <linux/types.h>

struct mallocator
{
    struct hlist_node node;
    void *start;
    unsigned long size;
    unsigned long used;
    unsigned long flags;

    void *(*alloc)(struct mallocator *m, unsigned long size, gfp_t flags, int node);
    void (*free)(struct mallocator *m, const void *object);

    void *priv;
};

void mallocator_register(struct mallocator *m);
